home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 2.7 KB | 137 lines | [TEXT/MPS ] |
- //
- // File: SLObjReg.idl
- //
- // Contains: Interface for OObjectRegistry class
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
-
- #ifndef SLOBJREG_IDL
- #define SLOBJREG_IDL
-
- #include <somobj.idl>
- #include <somcls.idl>
-
- #ifndef SLSTDDEF_IDL
- #include "SLStdDef.idl"
- #endif
-
-
- //==============================================================================
- // Classes defined in this interface
- //==============================================================================
-
- interface FW_OObjectRegistry;
- interface FW_OBasicObjectRegistry;
-
-
- //==============================================================================
- // Types defined by this interface
- //==============================================================================
-
- #if defined(__SOMIDL__)
- #pragma somemittypes on
- #endif
-
- typedef long FW_ObjectRegistry_ID;
- const FW_ObjectRegistry_ID FW_kNotInRegistry = -1;
-
- #if defined(__SOMIDL__)
- #pragma somemittypes off
- #endif
-
-
- interface FW_OObjectRegistry : SOMObject
- {
-
- FW_ObjectRegistry_ID RegisterObject(in void *object);
- // Register an object and returns the (unique) ID
-
- void RegisterObjectAndID(in void *object, in FW_ObjectRegistry_ID id);
- // Register an object to particular id.
- // The id must not already be in the registry.
-
- FW_ObjectRegistry_ID LookupByObject(in void *object);
- // Look up an object in the registry, return FW_kNotInRegistry if object not found.
-
- void* LookupByID(in FW_ObjectRegistry_ID id);
- // Find an object by ID, return its pointer.
- // Return 0 if id not in registry.
-
- #ifdef __SOMIDL__
- implementation
- {
- functionprefix = "FW_OObjectRegistry__";
-
- override:
- somInit,
- somUninit;
-
- releaseorder:
- somInit,
- somUninit,
-
- RegisterObject,
- RegisterObjectAndID,
- LookupByObject,
- LookupByID;
-
- majorversion = 1;
- minorversion = 0;
-
- passthru C_xh =
- "";
-
- passthru C_xih =
- "";
- };
- #endif
- };
-
- //========================================================================================
- // FW_OBasicObjectRegistry
- //========================================================================================
-
- interface FW_OBasicObjectRegistry : FW_OObjectRegistry
- {
- struct SAssociation
- {
- FW_ObjectRegistry_ID fID; // object id
- void* fObject; // object address
- };
-
- #ifdef __SOMIDL__
- implementation
- {
- functionprefix = "FW_OBasicObjectRegistry__";
-
- override:
- somInit,
- somUninit,
-
- RegisterObject,
- RegisterObjectAndID,
- LookupByObject,
- LookupByID;
-
- majorversion = 1;
- minorversion = 0;
-
- passthru C_xh =
- "";
-
- passthru C_xih =
- "";
-
- #ifdef __PRIVATE__
- SAssociation* fList;
- long fListLength;
- long fPhysicalListLength;
- FW_ObjectRegistry_ID fNextUnusedID;
- #endif
- };
- #endif
- };
-
- #endif
-